package sch.guo.crmsys.service.cop.impl;

import org.springframework.beans.factory.annotation.Autowired;
import sch.guo.crmsys.dto.cop.ChartDTO;
import sch.guo.crmsys.dto.cop.OrderDTO;
import sch.guo.crmsys.dto.cop.OrderStatementDTO;
import sch.guo.crmsys.entity.cop.CopOrder;
import sch.guo.crmsys.mapper.cop.CopOrderMapper;
import sch.guo.crmsys.service.cop.CopOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2019-12-31
 */
@Service
public class CopOrderServiceImpl extends ServiceImpl<CopOrderMapper, CopOrder> implements CopOrderService {

    @Autowired
    private CopOrderMapper copOrderMapper;

    @Override
    public List<OrderDTO> selectOrderList(Long userId, String clientName, int pageNum, int pageSize) {
        return copOrderMapper.selectOrderList(userId,clientName,pageNum,pageSize);
    }

    @Override
    public int countOrderList(Long userId,String clientName) {
        return copOrderMapper.countOrderList(userId,clientName);
    }

    @Override
    public List<OrderDTO> selectStatement(OrderStatementDTO orderStatementDTO) {

        return copOrderMapper.selectStatement(orderStatementDTO);

    }

    @Override
    public List<OrderDTO> selectRunningStatement(OrderStatementDTO orderStatementDTO) {
        return copOrderMapper.selectRunningStatement(orderStatementDTO);
    }

    @Override
    public List<ChartDTO> countSaleProductSize(int status, LocalDateTime time) {
        return copOrderMapper.countSaleProductSize(status,time);
    }

    @Override
    public List<ChartDTO> countSalePrice(int status, LocalDateTime time) {
        return copOrderMapper.countSalePrice(status,time);
    }

    @Override
    public List<ChartDTO> countClientBuy(int status, LocalDateTime time) {
        return copOrderMapper.countClientBuy(status,time);
    }

    @Override
    public List<ChartDTO> countClientGen(int status, LocalDateTime time) {
        return copOrderMapper.countClientGen(status,time);
    }
}
